package com.bw.zg2.view.adapter

import android.content.Context
import android.widget.ImageView
import android.widget.TextView
import com.bumptech.glide.Glide
import com.bw.zg2.R
import com.bw.zg2.bean.GoodsBeanItem
import com.zhy.adapter.recyclerview.CommonAdapter
import com.zhy.adapter.recyclerview.base.ViewHolder

/**
 *
 * @ClassName: HomeGoodsAdapter
 * @Description: java类作用描述
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/19 8:42 AM
 * @Version: 1.0
 */
class HomeGoodsAdapter(context: Context?, layoutId: Int, data: List<GoodsBeanItem>) :
    CommonAdapter<GoodsBeanItem>(context, layoutId, data) {
    override fun convert(holder: ViewHolder?, t: GoodsBeanItem?, position: Int) {
        holder?.setText(R.id.goods_tv_id,t?.goods_desc)
        val img = holder?.getView<ImageView>(R.id.goods_iv_id)
        img?.let { Glide.with(mContext).load(t?.goods_default_icon).into(it) }


    }
}